package com.lbs.jiepiaisi.utils;

import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;
import android.location.LocationManager;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.util.Log;

/**
 * @author ydm
 * @date 2018/5/21
 * @desc
 */

public class PhotoPerUtil {


  private static boolean checkPermissionGranted(Context context) {
      if (ContextCompat.checkSelfPermission(context, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED ) {
          ActivityCompat.requestPermissions((Activity) context,new String[]{Manifest.permission.CAMERA},0);
          return false;
      }
      return true;
  }
    /**
     * 检查相机服务、权限
     */
    public static boolean checkCameraPermission(Context context) {
        return checkPermissionGranted(context);
    }
}
